#include "PAP_defs.h"
#include "derivative.h"

#define TPM_PRESCALER_1     0
#define TPM_PRESCALER_2     1
#define TPM_PRESCALER_4     2
#define TPM_PRESCALER_8     3
#define TPM_PRESCALER_16    4
#define TPM_PRESCALER_32    5
#define TPM_PRESCALER_64    6
#define TPM_PRESCALER_128   7


#define TPM_DISABLED    0
#define TPM_BUS_CLOCK   1
#define TPM_XCLK        2
#define TPM_EXT_CLK     3

#define TPM_INTERRUPTS_ENABLED  1
#define TPM_INTERRUPTS_DISABLED 0

uint8 u8TPM_CheckTOF (uint8 u8timer);

void vfnTPM_PrescalerSelect (uint8 u8timer, uint8 u8prescaler);

void vfnTPM_SetModulo (uint8 u8timer, uint16 u16modulo);

void vfnTPM_ClockSelect (uint8 u8timer, uint8 u8clock);

void vfnTPM_EdgeAlignedPWM (uint8 u8timer, uint8 u8channel);

uint8 u8TPM_GetTimerCounter (uint8 u8timer);

void vfnTPM_ClearTOF (uint8 u8timer);

void vfnTPM_InterruptEnable (uint8 u8timer, uint8 u8status);

uint8 u8TPM_GetTimerCounterH (uint8 u8timer);

uint16 u16TPM_GetTimerCounter (uint8 u8timer);